package com.heima.zuoye.day07.timu2;

import java.util.*;

public class Demo1 {
    public static void main(String[] args) {
        ArrayList<Integer> arr = new ArrayList<>();
        Collections.addAll(arr, 1, 2, 3, 4, 5, 6, 10, 20, 30, 50);
        //打乱
        Collections.shuffle(arr);
        System.out.println(arr);
        //升序
        Collections.sort(arr);
        System.out.println(arr);
        //降序
        Collections.sort(arr, new Comparator<Integer>() {
            @Override
            public int compare(Integer o1, Integer o2) {
                return o2 - o1;
            }
        });
        System.out.println(arr);
    }
}
